export default {
    filters: {
        //改变时间格式
        formatDate(val) {
          // 个位数的值在前面补0
          function add0(num) {
            return num < 10 ? "0" + num : num;
          } 
          const date = new Date(val);
          const Y = date.getFullYear();
          const M = date.getMonth() + 1;
          const D = date.getDate();
          const h = date.getHours();
          const m = date.getMinutes();
    
          const dateString =Y +"-" +add0(M)+"-" +add0(D) +"  " +add0(h) +":" +add0(m);
          return dateString;
        },
      },
}